<?php

class globalFilterForm extends BaseForm {

    public function configure() {

        $defaults = AcademicYearTable::getInstance()->getDefaults();

        $this->setWidgets(array(
            'year' => new sfWidgetFormDoctrineChoice(array('model' => 'AcademicYear', 'method' => 'getAcademicYear', 'default' => $defaults['id']))
            , 'semester' => new sfWidgetFormChoice(array('choices' => array('1' => 'First', '2' => 'Second'), 'default' => $defaults['semseter_number']))
        ));

        $this->widgetSchema->setNameFormat('global_filter[%s]');
    }

}